import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Home,
    redirect: '/index',
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import ('../views/Index')
      },
      {
        path: 'type',
        name: 'type',
        component: () => import ('../views/Type')
      },
      {
        path: 'cart',
        name: 'cart',
        component: () => import ('../views/Cart')
      },
      {
        path: 'profile',
        name: 'profile',
        component: () => import ('../views/Profile')
      }
    ]
  },
  {
    path: '/detail',
    component: () => import ('../views/Detail')
  }
]

const router = new VueRouter({
  routes
})

export default router
